<template>
  <div class="cu-common-layout">
    <div class="cu-common-layout-center">
      <el-row class="cu-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          <el-col :span="6">
            <el-form-item label="姓名">
              <el-input v-model="query.name" clearable placeholder="输入姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="部门">
              <custom-tree-select v-model="query.departmentId" :options="departmentTreeData" placeholder="选择部门" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
              <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="cu-common-layout-main cu-flex-main">
        <div class="cu-common-head">
          <div>
            <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button>
          </div>
          <div class="cu-common-head-right">
            <el-tooltip effect="dark" content="刷新" placement="top">
              <el-link icon="icon-ym icon-ym-Refresh cu-common-head-icon" :underline="false" @click="reset()" />
            </el-tooltip>
            <screenfull isContainer />
          </div>
        </div>
        <custom-table v-loading="listLoading" :data="list">

          <el-table-column prop="courseName" label="课程名称" align="center" width="120" >
          </el-table-column>
          <el-table-column prop="courseIntroduction" label="课程简介" align="center"min-width="160" show-overflow-tooltip>
          </el-table-column>
          <el-table-column prop="courseObjective" label="课程目标" align="center" width="120">
          </el-table-column>
          <el-table-column prop="targetAudience" label="适用对象" align="center" width="180" show-overflow-tooltip>
          </el-table-column>

          <el-table-column prop="courseDuration" label="课程时长" align="left" width="120" show-overflow-tooltip>
          </el-table-column>
          <el-table-column prop="" label="关联讲师" align="left"  show-overflow-tooltip></el-table-column>

          <el-table-column label="操作" width="160" fixed="right">
            <template slot-scope="scope">
              <el-button  type="text" size="mini"  @click="addOrUpdateHandle(scope.row)">编辑</el-button>
              <el-button  type="text" size="mini"  @click="addOrUpdateHandle(scope.row, true)">资料</el-button>
              <el-button  type="text" size="mini" @click='handleDel(scope.row.id)'>删除</el-button>
            </template>
          </el-table-column>
        </custom-table>
        <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" />
      </div>
    </div>
    <custom-form v-if="formVisible" ref="CustomForm" @refresh="search" />
  </div>
</template>
<script>
export { default } from './index.js'
</script>
<style lang="scss" scoped>
@import url(index.scss);
</style>
